import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/questionnaire/list',
  },
  {
    path: '/questionnaire/list',
    name: 'QueryQuestionnaire',
    component: () => import('@/pages/questionnaire/list/index.vue'),
  },
  {
    path: '/questionnaire/basic-info',
    name: 'QuestionnaireBasicInfo',
    component: () => import('@/pages/questionnaire/basic-info/index.vue'),
  },
  {
    path: '/questionnaire/design',
    name: 'QuestionnaireDesign',
    component: () => import('@/pages/questionnaire/design/index.vue'),
    children: [
      {
        path: '/questionnaire/design/question-design/:status',
        name: 'QuestionDesign',
        component: () => import('@/components/design/question-design-panel'),
      },
    ],
  },
  {
    path: '/questionnaire/old/basic-info',
    name: 'QuestionnaireOldBasicInfo',
    component: () => import('@/pages/questionnaire-old/basic-info'),
  },

  // {
  //   path: '/',
  //   redirect: '/questionnaire/list',
  // },
  // {
  //   path: '/questionnaire/list',
  //   name: 'QueryQuestionnaire',
  //   component: () => import('@/pages/questionnaire/list'),
  // },
  // {
  //   path: '/questionnaire/design',
  //   name: 'QuestionnaireDesign',
  //   component: () => import('@/pages/questionnaire/design'),
  // },
  // {
  //   path: '/questionnaire/designPanelLayout',
  //   name: 'QuestionnaireDesignNew',
  //   component: () => import('@/pages/questionnaire/design-new'),
  //   children: [
  //     {
  //       path: '/questionnaire/designPanelLayout/question-design',
  //       name: 'questionDesignPaenl',
  //       component: () => import('@/components/question/design-panel-layout/question-design-panel'),
  //     },
  //   ],
  // },
  {
    path: '/questionnaire/add',
    name: 'QuestionnaireAdd',
    component: () => import('@/pages/questionnaire-old/add'),
  },
  // {
  //   path: '/questionnaire/basic-info',
  //   name: 'QuestionnaireBasicInfo',
  //   component: () => import('@/pages/questionnaire/basic-info'),
  // },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
